<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateOpenShopEmployeeNoticesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('open_shop_employee_notices', function (Blueprint $table) {
            $table->id();
            $table->string('content', 255)->default('')->comment('通知内容');
            $table->unsignedBigInteger('orderId')->index('orderId')->default(0)->comment('通知相关的订单id');
            $table->string('shopCode', 12)->default('')->comment('店铺编号');
            $table->string('shopName', 64)->default('')->comment('店铺名称');
            $table->unsignedBigInteger('userId')->index('userId')->default(0)->comment('被通知人的userId');
            $table->unsignedTinyInteger('read')->default(0)->comment('是否已读');
            $table->unsignedInteger('readAt')->default(0)->comment('已读时间点');
            $table->string('operatorName', 32)->default('')->comment('操作人的姓名');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('操作人的id，rms后台用户的id，0-系统');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('操作人的id，rms后台用户的id，0-系统');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '店铺筹备 - 员工通知列表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('open_shop_employee_notices');
    }
}
